using System.Collections;
using System.Collections.Generic;
using System.Net.NetworkInformation;
#if UNITY_EDITOR // => Ignore from here to next endif if not in editor
using UnityEditor;
namespace JSG.BubbleShoot
{

    using UnityEngine;


    [CustomEditor(typeof(LevelBase))]
    public class LevelEditor : Editor
    {
        public float m_StartAngle = 0;
        public float m_DeltaAngle = 45;

        public int m_DeltaAngleNum = 0;
        public int m_StartAngleNum = 0;
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            LevelBase level = (LevelBase)target;

            if (GUILayout.Button("GenerateRings"))
            {
                level.m_BallPrefab = Resources.Load<GameObject>("level-editor-ball");
                level.m_BallSprites = new Sprite[6];
                level.m_BallSprites[0] = Resources.Load<Sprite>("ball (1)");
                level.m_BallSprites[1] = Resources.Load<Sprite>("ball (2)");
                level.m_BallSprites[2] = Resources.Load<Sprite>("ball (3)");
                level.m_BallSprites[3] = Resources.Load<Sprite>("ball (4)");
                level.m_BallSprites[4] = Resources.Load<Sprite>("ball (5)");
                level.m_BallSprites[5] = Resources.Load<Sprite>("ball (6)");
                level.m_BombSprite = Resources.Load<Sprite>("ball-bomb-1");
                level.GenerateBalls();
                //level.FillAllRings2();
                level.m_Generated = true;
                EditorUtility.SetDirty(target);
            }


        }
    }
}
#endif